package com.yang.system.adapter.driven.restful.orgMng;

import com.yang.system.application.orgMng.orgService.OrgResponse;
import com.yang.system.application.orgMng.orgService.OrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrgController {
    private  final OrgService orgService;
    @Autowired
    public OrgController(OrgService orgService) {
        this.orgService = orgService;
    }

    @PostMapping("/api/organizations")
    public OrgResponse addOrg(@RequestBody OrgResponse request) {
        Long userId=request.getTenantId();
        return orgService.addOrg(request,userId);
    }
}